package com.transport.action;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.transport.model.Cars;
import com.transport.service.CarsService;
import com.transport.utils.BaseAction;

public class CarsAction extends BaseAction{

	private CarsService carsService;
	private Cars cars;
	public CarsService getCarsService() {
		return carsService;
	}
	public void setCarsService(CarsService carsService) {
		this.carsService = carsService;
	}
	public Cars getCars() {
		return cars;
	}
	public void setCars(Cars cars) {
		this.cars = cars;
	}

	public String bindSelect(){
		HttpServletResponse response = ServletActionContext.getResponse();
		HttpServletRequest request = ServletActionContext.getRequest();
		List<String> list = carsService.bindSelect(cars);
		try {
			response.setCharacterEncoding("utf-8");
			response.getWriter().write(list.toString());
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}


}
